/* DivGraphic 相关的样式 */

/* Div 图元基础样式 */
.cesium-extensions-div-base {
  position: absolute;
  box-sizing: border-box;
  z-index: 9999;
  pointer-events: auto;
  user-select: none;
  display: block;
  width: auto;
  height: auto;
}

/* 图元选中状态 */
.cesium-extensions-div-base-selected {
  border: 2px solid #ff0000 !important;
}

/* 禁用鼠标交互 */
.cesium-extensions-div-no-pointer {
  pointer-events: none;
}

/* 允许文本选择 */
.cesium-extensions-div-selectable {
  user-select: text;
}

/* 隐藏图元 */
.cesium-extensions-div-hidden {
  display: none;
}

/* 图片标签样式 */
.cesium-extensions-image-label {
  overflow: hidden;
  /* 确保图片不会溢出容器 */
}

/* 图片标签内的图片样式 */
.cesium-extensions-image-label img {
  display: block;
  border: none;
  outline: none;
}

/* 多行文本标签样式 */
.cesium-extensions-multiline-label-container {
  padding: 5px 8px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 圆角标签锚点容器 */
.cesium-extensions-fillet-label-anchor-container {
  position: relative;
  /* 这个容器主要用于定位，具体样式通过子元素实现 */
}

/* 圆角标签容器样式 */
.cesium-extensions-fillet-label-container {
  text-align: center;
  padding: 5px 30px;
  margin: 0;
  color: #fff;
  /* 使用CSS变量实现动态渐变背景 */
  --gradient-color-1: rgba(7, 10, 203, 0.75);
  --gradient-color-2: rgb(16, 238, 220);
  --connector-color: #2bcdbb;
  background: linear-gradient(var(--gradient-color-1), var(--gradient-color-2));
  border-radius: 5px;
  max-height: 130px;
  user-select: none;
  white-space: nowrap;
  z-index: 2;
  position: relative;
}

/* 使用伪元素实现连接线 */
.cesium-extensions-fillet-label-container::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: calc(50% - 1.5px);
  display: block;
  width: 3px;
  height: 60px;
  background-color: var(--connector-color, #2bcdbb);
  z-index: 1;
}

/* 圆角标签行样式 */
.cesium-extensions-fillet-label-line {
  color: #ffffff;
  font-size: 14px;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cesium-extensions-multiline-label-container.type-1 {
  /* 类型1特有的样式 */
  text-align: center;
}

.cesium-extensions-multiline-label-container.type-2 {
  /* 类型2特有的样式 - 基于黑色面板样式 */
  min-width: 90px;
  min-height: 35px;
  position: absolute;
  left: 16px;
  bottom: 31px;
  cursor: default;
  border-radius: 4px;
  opacity: 0.96;
  border: 1px solid #14171c;
  box-shadow: 0px 2px 21px 0px rgba(33, 34, 39, 0.55);
  box-sizing: border-box;
  background: linear-gradient(0deg, #1e202a 0%, #0d1013 100%);
  text-align: center;
  padding: 0;
}

/* 类型2的伪元素样式 - 指向左下角的连线 */
.cesium-extensions-multiline-label-container.type-2::before {
  content: "";
  width: calc(100% + 22px);
  height: 39px;
  position: absolute;
  bottom: -39px;
  left: -22px;
  background: url("./img/blackPanel-bg.png") 0px 0px no-repeat;
  background-position: 0px 0px;
}

/* 类型2无图片时的文本样式 */
.cesium-extensions-multiline-label-container.type-2
  .cesium-extensions-multiline-label-line {
  width: 100%;
  min-height: 33px;
  text-align: center;
  padding: 10px 5px 0 5px;
  margin: 0;
  border: 1px solid #ffffff4f;
  box-sizing: border-box;
  white-space: nowrap;
}

/* 保留旧的type-3样式以保持向后兼容性 */
.cesium-extensions-multiline-label-container.type-3 {
  text-align: center;
  padding: 5px 30px;
  margin: 0;
  color: #fff;
  background: linear-gradient(rgba(7, 10, 203, 0.75), rgb(16, 238, 220));
  border-radius: 5px;
  max-height: 130px;
  user-select: none;
  white-space: nowrap;
  transform: translateY(calc(-50% - 60px));
}

/* 类型3的伪元素样式 - 中间竖直连线 */
.cesium-extensions-multiline-label-container.type-3::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: calc(50% - 3px);
  display: block;
  width: 3px;
  height: 60px;
  border-right: 3px solid #2bcdbb;
}

/* 类型3高亮样式 */
.cesium-extensions-multiline-label-container.type-3.highlight {
  border: 2px solid yellow;
}

.cesium-extensions-multiline-label-container.type-3.highlight::after {
  border-right: 3px solid yellow;
}

/* 圆角标签高亮样式 */
.cesium-extensions-fillet-label-container.highlight {
  border: 2px solid yellow;
}

.cesium-extensions-multiline-label-line {
  color: #ffffff;
  font-size: 14px;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.cesium-extensions-multiline-label-anchor {
  display: block;
  margin: 0 auto;
}

/* 边框动画标签 */
.cesium-extensions-div-border-label {
  position: absolute;
  left: 0px;
  bottom: 0px;
  cursor: pointer;
  --animation-name: cesium-extensions-div-border-label-animation;
  --text-left-position: -75px;
  --border-color: #15d1f2;
  --box-shadow-color: #15d1f2;
  --text-color: #ffffff;
  --text-font-size: 14px;
  --border-width: 120px;
  --border-height: 30px;
  --clip-width-1: 120px;
  --clip-width-2: calc(100% - 2px);
  --clip-height-1: 30px;
  --clip-height-2: calc(100% - 2px);
  width: var(--border-width);
  height: var(--border-height);
}

/* 动画关键帧 */
@keyframes cesium-extensions-div-border-label-animation {
  0%,
  100% {
    clip: rect(0px, var(--clip-width-1), 2px, 0px);
  }
  25% {
    clip: rect(0px, 2px, var(--clip-height-1), 0px);
  }
  50% {
    clip: rect(
      var(--clip-height-2),
      var(--clip-width-1),
      var(--clip-width-1),
      0px
    );
  }
  75% {
    clip: rect(
      0px,
      var(--clip-width-1),
      var(--clip-height-1),
      var(--clip-width-2)
    );
  }
}

/* 边框元素样式 */
.cesium-extensions-div-border-label-border {
  width: var(--border-width);
  height: var(--border-height);
  color: var(--border-color);
  box-shadow: inset 0 0 0 1px var(--box-shadow-color);
  margin: auto;
}

/* 边框元素及其伪元素的公共定位样式 */
.cesium-extensions-div-border-label-border,
.cesium-extensions-div-border-label-border::before,
.cesium-extensions-div-border-label-border::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

/* 文本元素样式 */
.cesium-extensions-div-border-label-text {
  color: var(--text-color);
  font-size: var(--text-font-size);
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: bolder;
  user-select: none;
  cursor: pointer;
}

/* 伪元素样式 - 使用绝对的动画名称而非变量，确保正确应用 */
.cesium-extensions-div-border-label-border::before,
.cesium-extensions-div-border-label-border::after {
  content: "";
  margin: -5%;
  box-shadow: inset 0 0 0 2px;
  animation: cesium-extensions-div-border-label-animation 8s linear infinite;
  /* 确保伪元素在正确的层上 */
  z-index: -1;
}

/* 为第一个伪元素添加时间延迟，使两条边框动画错开显示 */
.cesium-extensions-div-border-label-border::before {
  animation-delay: -4s;
}

/* 竖立的文本标签样式 */
.cesium-extensions-div-up-label {
  text-align: center;
  background: transparent;
  color: white;
  display: block;
  box-sizing: border-box;
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-name: cesium-extensions-div-up-label-tinUpIn;
}

/* 竖排文本样式 */
.cesium-extensions-div-up-label-text {
  writing-mode: vertical-lr;
  font-size: var(--font-size, 16px);
  letter-spacing: 4px;
  color: var(--text-color, white);
}

/* 连接线样式 */
.cesium-extensions-div-up-label-line {
  display: block;
  height: var(--line-height, 100px);
  width: 1.5px;
  margin-left: calc(50% - 1px);
  margin-top: 3px;
  background-color: var(--line-color, white);
}

/* 底部圆点样式 */
.cesium-extensions-div-up-label-dot {
  display: block;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  margin-left: calc(50% - 4px);
  background-color: var(--dot-color, white);
}

/* 竖排标签动画 */
@keyframes cesium-extensions-div-up-label-tinUpIn {
  0% {
    opacity: 0;
    transform: scale(1, 1) translateY(-900%);
  }
  50%,
  70%,
  90% {
    opacity: 1;
    transform: scale(1.1, 1.1) translateY(0);
  }
  100%,
  60%,
  80% {
    opacity: 1;
    transform: scale(1, 1) translateY(0);
  }
}

/**************** 一个简洁文本面板,中间竖直连线 ****************/
.cesium-extensions-green-gradient-panel {
  width: 100px;
  text-align: center;
  background-image: linear-gradient(to right, #565d39, #00ffc3);
  position: relative;
  left: -1px;
  bottom: 29px;
  cursor: default;
  padding: 5px;
  border: 1px solid #9c9944e8;
}

.cesium-extensions-green-gradient-panel:hover {
  border: 1px solid rgb(9, 255, 0);
}

.cesium-extensions-green-gradient-panel::before {
  position: absolute;
  content: "";
  left: 50%;
  bottom: -30px;
  height: 30px;
  border-left: 2px dashed #c5e22770;
}

.cesium-extensions-green-gradient-panel-highlight {
  border: 2px solid yellow;
}

.cesium-extensions-green-gradient-panel-highlight::before {
  border-left: 2px dashed yellow !important;
}